<% abi = format_abi(@custom_abi) %>
<section class="container">
  <div class="row">
    <%= render BlockScoutWeb.Account.CommonView, "_nav.html", conn: @conn, active_item: :custom_abis %>
    <div class="col-sm-10">
      <div class="card">
        <div class="card-body">
          <h1 class="card-title list-title-description header-account"><%=if @method == :update, do: gettext("Update"), else: gettext("Add") %> <%= gettext "Custom ABI"%></h1>
          <div class="col-sm-10 card-body-account">
            <% path = if @method == :update, do: custom_abi_path(@conn, @method, @custom_abi.data.id), else: custom_abi_path(@conn, @method) %>
            <%= form_for @custom_abi, path, fn f -> %>
              <div class="form-group">
                <%= label f, :name, gettext("Name"), class: "control-label", style: "font-size: 14px" %>
                <%= text_input f, :name, class: "form-control", placeholder: gettext("Name this Custom ABI"), maxlength: 255 %>
                <%= error_tag f, :name, class: "text-danger form-error" %>
              </div>
              <div class="form-group">
                <%= label f, :address_hash, gettext("Contract Address"), class: "control-label", style: "font-size: 14px" %>
                <%= text_input f, :address_hash, class: "form-control", placeholder: "0x0000000000000000000000000000000000000000", maxlength: 42 %>
                <%= error_tag f, :address_hash, class: "text-danger form-error" %>
                <%= error_tag f, :identity_id, class: "text-danger form-error" %>
              </div>
              <div class="form-group">
                <%= label f, :abi, gettext("ABI"), class: "control-label", style: "font-size: 14px" %>
                <%= textarea f, :abi, class: "form-control", placeholder: "[{...}]", value: abi %>
                <%= error_tag f, :abi, class: "text-danger form-error" %>
              </div>
              <br>
              <div class="form-group float-right form-input">
                <a class="btn btn-line" href="<%= custom_abi_path(@conn, :index) %>"><%= gettext "Back to Custom ABI (Cancel)"%></a>
                <%= submit gettext("Save"), class: "save-custom-abi-button button button-primary button-sm ml-3" %>
              </div>
            <% end %>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
